package com.qqtech.qquan.push.enums;

public enum PushBizzEnum {

	APP_UPGRADE(101, "APP升级"),
	APP_UPGRADE_WHOLE(102, "APP全部更新"),
	APP_UPGRADE_UPDATE(103, "针对特定设备更新"),
	APP_UPGRADE_BYVERSION(104, "根据客户端内容版本进行增量升级"),
	APP_UPGRADE_NATIVE(105, "根据客户端原生版本安装升级"),
	USERTOPIC_UPDATE(201, "友事更新"),
	COMMENTED(301, "被评论"),
	REPLY2COMMENTED(302, "评论被回复"),//某人回复了我的评论
	PRAISED(401, "被点赞"),
	USER_ADDED_FRIEND(501, "被加好友"),
	USER_IM_BGNOTIFY(502, "用户处于后台时的IM消息推送通知"),
	USER_STATUS_OFF(503, "同一账户在另一设备登录时则之前的设备要下线"),
	USER_REALAUTH(504, "用户身份认证"),
	USER_COMMUNITYAUTH(505, "社区住户认证"),
	USER_BEINVITED_CIRCLE(506, "被邀请加入圈子"),
	USER_BEAPPLYED_CIRCLE(507, "被申请加入圈子"),//圈主或管理员收到推送【某人申请加入你的圈子】
	ORDER_SELECTED(601, "买家下单"),
	ORDER_PAYED(602, "买家已付款"),
	ORDER_SENTED(603, "卖家已发货"),
	ORDER_SIGNED(604, "买家已签收"),
	ORDER_CANCEL_BUYER(605, "买家已取消"),
	ORDER_CANCEL_SELLER(606, "卖家已取消"),
	ORDER_APPLYRETURN(607, "买家申请退货"),
	ORDER_RETURNED(608, "卖家同意退货"),
	ORDER_RETURN_PAY_APPLY(609, "买家申请退款"),
	ORDER_RETURN_PAY_AGREE(610, "卖家或圈圈同意退款"),
	ORDER_RETURN_PAY_REFUSE(611, "卖家拒绝退款"),
	SEND_ORDER_NOTIFY(701, "配送单通知给配送方"),
	HONOR_NOTICE_COMMON(801, "荣誉系统通知"),
	COUPON_NOTICE_COMMON(802, "优惠卷系统通知"),
	SYS_ADMIN(901, "系统后台推送"),
	SHOP_OPEN(902, "店铺推送"),
	ACTIVITY_OPEN(903, "社区活动推送"),
	OTHER(9999, "其它");
	
	private int code;
	private String desc;

	private PushBizzEnum(int code, String desc) {
		this.desc = desc;
		this.code = code;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public static String getDesc(Integer code) {
		PushBizzEnum statusEnum = getInstance(code);
		if (statusEnum != null) {
			return statusEnum.getDesc();
		}
		return "";
	}

	public static PushBizzEnum getInstance(Integer code) {
		if (code != null) {
			for (PushBizzEnum statusEnum : PushBizzEnum.values()) {
				if (code.equals(statusEnum.getCode())) {
					return statusEnum;
				}
			}
		}
		return null;
	}
}
